import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;


public class SaeifE {
private BurningForstSimulationExtended simulation;
	
	private double s=0.05;

	
	public void startTest() throws IOException {
        BufferedWriter out = new BufferedWriter(new FileWriter("out.txt"));
        
        
		while (s <=1.05){
			doSimulation();
			double measure = simulation.getLocalMeasure();
			System.out.println("s="+s + " global measure is  " +measure);
	        out.write(s+";"+measure);
	        out.newLine();	
			s = s+0.05;
			
		}
		out.flush();
		out.close();
	}
	private void doSimulation() {
		simulation=  new BurningForstSimulationExtended();
		simulation.d_plantingProb=1;
		simulation.f_lightningStrikeProb=0.5;
		simulation.p_growNewPlantProb=0.35;
		simulation.g_combustibilityProb=0.0001;
		simulation.s_neighborSeedingProb=s;
		
		simulation.initCellularAutomatonWithTreesCol();
		
		int gen = 0;
		while (gen<Constants.GENERATION_LIMIT) {
			simulation.evolveToNextGeneration();
			gen++;
		}
		
	}
}
